/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import Taro, { Component } from '@tarojs/taro'
import { Image } from '@tarojs/components'
import { AtSwipeAction } from "taro-ui"

// project
import { CPage, CContent, CHeader, CFooter, CFloat, CAround, CBetween, CCenter, CRow, CWrap, CLine, CHand, CItemX, CItemY, CText, CLabel, CSvg, CImage, CButton, CColumn } from '../../../library/comp';
import { Base64, Gen, Time, Zip, Session, Storage, Toast} from '../../../library/func';
import Icon from '../../../project/style/icon';
import Http from '../../../project/func/http/http'

/******************************************************************************************
 * Export Class
 ******************************************************************************************/

export default class Listunitone extends Component {

	constructor(props) {
		super(props);

		/**
		 * state
		 */
		this.state = {

            // 获取屏幕高度
			scrollHeight: wx.getSystemInfoSync().windowHeight
		}
    }
    
    /*------------------------------------------------------------------------------------
	 * 自定义方法
	 *-----------------------------------------------------------------------------------*/


	/**
	 * 渲染
	 */
	render() {
    	return (
			<CColumn class="w1" bg='#fff' mb='10' mt='10'>

                {
                    this.props.singe ? 
                    <AtSwipeAction autoClose style='width:100%; margin:0 auto;' options={[
                        {
                            text: '删除',
                            style: {
                            height:'400rpx',
                            backgroundColor: '#FF4949'
                            }
                        },
                    ]}>
                        <CColumn pa='10' class="w1">
                            <CLine onClick={ this.props.onFunction }>
                                <Image src={this.props.data.object.set_cover} style='width:100%; height:300rpx;'/>
                                {/*<Image src='https://wx1.sinaimg.cn/mw690/d066dac5ly1fxekrr5jrij20uk0h5tbz.jpg' style='width:100%; height:300rpx;'/>*/}
                            </CLine>
                            <CLine color='#8c8c8c' size='14' pt='10'>{this.props.data.set_title}</CLine>
                        </CColumn>
                    </AtSwipeAction>    
                    :
                    <CLine class="w1">
                        <CColumn pa='10' class="w1">
                            <CLine onClick={ this.props.onFunction }>
                                <Image src={this.props.data.object.set_cover} style='width:100%; height:300rpx;'/>
                                {/*<Image src='https://wx1.sinaimg.cn/mw690/d066dac5ly1fxekrr5jrij20uk0h5tbz.jpg' style='width:100%; height:300rpx;'/>*/}
                            </CLine>
                            <CLine color='#8c8c8c' size='14' pt='10'>{this.props.data.set_title}</CLine>
                        </CColumn>
                    </CLine>
                }





			</CColumn>
		);
	}
};